Controller for a Downhole Tool

ABSTRACT

The controller comprises housing ( 2 ) within which located is an inner mandrel ( 4 ), which is biased in an upward direction by spring ( 16 ). Balls ( 10 ) in ducts ( 8 ) are locking the inner mandrel to housing ( 2 ). At a lower end of mandrel ( 4 ) are a plurality of ports ( 18 ) which may be aligned with a set of outer ports ( 22 ). When ports ( 18 ) are to be aligned with ports ( 22 ), the drill string is rotated, generating a centrifugal force which forces balls ( 10 ) radially along ducts ( 8 ), thereby unlocking inner mandrel from outer housing. Pressure is then applied to inner duct ( 7 ), creating a pressure difference across choke ( 6 ). Under sufficient pressure, the force created is sufficient to overcome the resistive force created by spring ( 16 ), and thus the inner mandrel translates axially to bring ports ( 18 ) in alignment with ports ( 22 ), through which some or all of the drilling fluid may flow, bypassing the rest of the drill string.

BACKGROUND

In various industries, for example the oil extraction industry, it is necessary to control certain pieces of equipment at a considerable distance from where the operator is positioned. In some industries this can be achieved by the use of radio-controlled apparatus, but this may not be practicable with submarine or deep subterranean drilling operations. The control apparatus can, in certain technical fields, be actuated by electrical signals passed through electrical conductors or by telemetry and telecommand systems. Due to the severe conditions encountered in oil or gas wellbores it is desirable to provide a simple control means which is still capable of complex functionality.

In conventional drilling operations a drill string, formed of lengths of drill pipe joined in end-to-end relationship, is fed down the wellbore. Whilst it may be desirable to actuate a device at an intermediate region along the length of the drill string, often the most important device to control is at that part of the drill string furthest from the operator, i.e. at or near the drill bit.

Generally speaking the drill string can be regarded as a hollow duct, through which drilling fluid (also known as drilling mud) is passed under pressure. Under certain circumstances it is desirable to allow the drilling fluid being passed under pressure down the drill string to by-pass the drill bit, by venting through lateral ports and returning up the bore hole. Thus, it is desirable to be able to control effectively the opening and closing of such ports or the access to, and shutting off of, such ports.

Furthermore, it may also be desirable to actuate a steering stabiliser incorporated in the drill string. Such a stabiliser may have a plurality of elements capable of being moved radially outwardly either concentrically or eccentrically, under suitable actuation, so as to engage the internal surface of the wellbore. The elements and the housing with which they are associated are thus prevented from rotation relative to the wellbore, whereas the mandrel within the housing, forms part of the main duct of the drill string, and is free to continue to rotate. Conversely the housing may be locked to the mandrel.

Moreover, in a three-dimensional steering tool, where there is an articulated joint, it is necessary to impart some degree of eccentricity to the drill string immediately upstream of the joint, the effect of which is that the drill bit, on the remote side of the articulated joint, is forced out of a rectilinear relationship, thereby enabling the drill string to be “steered”.

Conventional downhole tools perform the above functions in response to only one input parameter, i.e. a predetermined drilling fluid pressure, flow, or pressure pulses occurring. This limits the functional flexibility of the tool and in many cases means that tools cannot maintain position or control without a continuous input of a single active drilling parameter, i.e. flow, pressure, weight, or rotation.

Accordingly the present invention seeks to address the problems mentioned above.

STATEMENT OF THE INVENTION

According to a first aspect of the present invention, there is provided a controller for switching between functional modes of a downhole tool, the controller comprising: a switching device adapted for switching between a plurality of functional modes; and a sensing device adapted to sense a plurality of input parameters; wherein the switching device switches from a first of the functional modes to a second of the functional modes when the sensing device senses a predetermined state of at least two of the said input parameters.

In an embodiment of the present invention the controller can maintain or switch between functional modes of a downhole tool in response to more than one input parameter, wherein the action taken may depend upon the sequence of two or more different input parameters, i.e. pressure change before rotation or rotation change before pressure change.

The switching device may only switch from a first of the functional modes to a second of the functional modes when the sensing device senses a predetermined state of at least two of the said input parameters.

The switching device may switch functional modes in response to the sensing device sensing a predetermined change in one of said input parameters.

The sensing device may sense the order in which the input parameters change, the switching device switching to or maintaining a first functional mode when the sensing means senses a first order and another functional mode when the sensing device senses a different order.

The controller may comprise an outer housing and an inner mandrel rotatable within the outer housing, through which drilling fluid may pass.

The inner mandrel may comprise a choke to provide a pressure difference inside the mandrel.

The inner mandrel may be translated within the housing in the direction of flow and/or rotated, in response to said pressure difference.

A resistive force may be provided to resist translation of the inner mandrel in response to said pressure difference.

One of the said plurality of input parameters may be the rate of rotation of the downhole tool.

One of the said plurality of input parameters may be a flow variable of a drilling fluid flowing through the downhole tool. The flow variable may be the pressure of the drilling fluid. The flow variable may be the flow rate of the drilling fluid.

The functional modes may include any one of acting as a conventional drill pipe, opening ports, moving stabilisers, blades or sleeves, or a steering operation of the drill string or drill bit.

The switching device may determine the functional mode from the axially translated and or rotated displacement of the mandrel within the housing.

The switching device may be prevented from switching between functional modes unless one of the input parameters is at, under or exceeds a predetermined value. The input parameter may be at least one of the following: the rate of rotation of the downhole tool, the rate of rotation of the inner mandrel, the pressure of the drilling fluid, the flow rate of the drilling fluid, or the rate of pressure change of the drilling fluid.

The switching device may be prevented from switching the functional mode by locking the inner mandrel relative to the housing to prevent axial and or rotational translation.

The housing may comprise a plurality of circumferentially aligned balls or locking means which, when the downhole tool is rotating below a specific rate, protrude from the inner surface of the housing, if unobstructed, and which are flush with the inner surface of the housing when the downhole tool is rotating at or above this rate. A circumferential groove may be formed on the inner mandrel which receives said plurality of balls or locking means when rotation is below the specific rate and prevents axial translation and or rotation. There may be a plurality of grooves formed on the outer surface of the inner mandrel.

The housing may comprise more than one circumferentially aligned set of balls or locking means. The balls or locking means may be provided in an inclined port in the housing wall. The balls or locking means may be spring loaded. Whilst the balls protrude from the inner surface of the housing, if the pressure of the drilling fluid is a predetermined value, then the balls may be prevented from becoming flush with the inner surface of the housing. The positions of the balls or locking means may relate to a specific functional mode.

The inner mandrel may be locked relative to the housing by a locking means. The locking means may be controlled by a solenoid, hydraulics, or by electrical means.

The switching device may be an actuator. The sensing device may be an electrical or electromagnetic device.

According to a second aspect of the present invention, there is provided a method of switching between functional modes of a downhole tool comprising: a sensing step, wherein a plurality of input parameters are sensed; and a switching step, wherein the functional mode of the downhole tool can be switched from a first functional mode to a second functional mode when a predetermined state of at least two of the said input parameters is sensed in the sensing step.

The functional modes may be switched in response to the sensing of a predetermined change in one of said input parameters.

In the sensing step, the order in which the input parameters change may be sensed, and in the switching step a first functional mode may be maintained or switched to when the sensing step senses a first order and another functional mode may be maintained or switched to when the sensing step senses a different order.

BRIEF DESCRIPTION OF THE DRAWINGS

For a better understanding of the present invention, and to show more clearly how it may be carried into effect, reference will now be made by way of example, to the following drawings, in which:

FIG. 1 is a vertical cross-section of a controller for a downhole tool according to a first embodiment of the present invention.

FIG. 2 is a vertical cross-section of a controller for a downhole tool according to a second embodiment of the present invention.

FIG. 3 is a second vertical cross-section of the controller of FIG. 1.

FIG. 4 is a second vertical cross-section of the controller of FIG. 2.

FIG. 5 is a perspective view of the controller according to the first embodiment in a first position.

FIG. 6 is a perspective view of the controller according to the second embodiment in a first position.

FIG. 7 is a perspective view of the controller according to the first embodiment during switching between a first and second position.

FIG. 8 is a perspective view of the controller according to the second embodiment during switching between a first and second position.

FIG. 9 is a flow chart showing the operation of a first embodiment of the controller.

FIG. 10 is a flow chart showing the operation of a second embodiment of the controller.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS

Referring to FIG. 1, in which a first embodiment of the present invention is shown, a downhole tool comprising a controller 3 is generally indicated at 1. The downhole tool comprises a substantially cylindrical outer housing 2. Located within outer housing 2 is an inner mandrel 4, which has a smaller outer diameter than the inner diameter of the outer housing 2. The mandrel 4 may be formed from a number of constituent parts which together form a substantially continuous inner surface 5. The inner surface 5 of the mandrel 4 defines a hollow duct 7, through which drilling fluid may pass. A choke 6, which may be a separate part or may be integral to the mandrel 4, extends from a portion of the inner surface 5 towards the axial centre of the hollow duct 7. Positioned within the wall of the housing 2 are a plurality of substantially circumferentially aligned ports 8 which extend from an inner opening 9 in the inner surface of the housing towards an outer opening 11 in the outer surface of the outer housing 2. The ports 8 may be inclined and the outer opening 11 may be closed by a bolt, bung or other such means 13. A ball 10 of smaller outer diameter than the port 8 is positioned within the port 8. On the outer surface of the mandrel 4 is a circumferential groove 12. At a lower end of the downhole tool 1 is a lower housing 15 located between the outer housing 2 and the mandrel 4. The lower housing 15 is fixed to the outer housing 2.

Located between the controller 3 and the lower housing 15 is a resistive assembly 16, generally in contact with an abutment shoulder 17 of the mandrel 4 and the upper edge 19 of the lower housing 15. The resistive assembly 16 may take any form which enables it to apply a resistive force between the controller 3 and the lower housing 15, for example, the resistive element 16 may be a spring as shown or an elastomeric element or a hydraulic assembly or any other such means capable of providing a resistive force. The lower housing may be incorporated into the outer housing 2 to form a one-piece construction.

At a lower end of the mandrel 4 are a plurality of ports 18 which may be aligned with a set of outer ports 20 or 22 which extend through the lower housing 15 and the outer housing 2, thus forming a plurality of open by-pass ports from the hollow duct 7 to the exterior of the downhole tool.

The downhole tool may have a conventional lower housing connector 24 secured to one end region and may have a conventional upper housing connector 26 secured to the other end region.

FIG. 2 shows a second embodiment of the present invention, in which the downhole tool is substantially as in the first embodiment, but in the second embodiment the outer surface of the mandrel 4 has a plurality of circumferential grooves 12 and 14. In an alternative embodiment, which is not shown, the outer surface of the mandrel 4 may have one circumferential groove and the housing 2 may have several sets of ports 8 or the outer surface of the mandrel 4 may have a plurality of circumferential grooves and also several sets of ports 8.

Referring now to FIGS. 3 and 4, in which the downhole tool 1 comprising the controller 3 of FIGS. 1 and 2 respectively is shown from another angle. The constituent parts described in relation to FIGS. 1 and 2 have been provided with the same reference numerals in FIGS. 3 and 4.

In addition to the ports 8, the outer housing may have a follower port 28 for locating a follower 30 in a substantially axial orientation slot 32. Although a substantially axial orientation slot 32 is shown here, it may be advantageous to use an orientation slot which maps any alternative path or to use a plurality of slots.

The operation of the downhole tool comprising the controller in accordance with an embodiment of the present invention will now be described with the aid of FIGS. 5 to 8.

In use, the downhole tool 1 will be connected to a number of other drill pipes to form a drill string. When performing conventional drilling, drilling fluid is forced through the hollow duct 7 in the drill string and may be used to power a drill bit for drilling subterranean formations. In a first functional mode the downhole tool will operate as a conventional drill pipe, allowing the drilling fluid to pass through the hollow duct 7. The choke 6, shown in FIGS. 1 to 4, creates a pressure difference across itself when drilling fluid is flowing through the drill string. However, as shown in FIGS. 5 and 6, the balls 10 protrude into the circumferential groove 12 preventing the inner mandrel 4 from moving in response to the pressure difference created by the fluid flow. The pressure difference causes a small translation of the inner mandrel 4 relative to the outer housing 2 which locks the balls 10 between the opposing edges of the ports 8 and the circumferential groove 12 of these two components.

Under certain circumstances it may be necessary to rotate the drill string. If the drill string is rotated when there is already a sufficient flow of drilling fluid through it, then, as previously described, the balls 10 will be locked between opposing edges of the ports 8 and the circumferential groove 12 and thus will prevent any relative translation between the inner mandrel 4 and the outer housing 2. In contrast, by rotating the drill string prior to applying a fluid flow, the balls 10 are free to move and will experience a centrifugal force which forces them radially along the ports 8 towards the outer opening 11 and therefore out of the circumferential groove 12. The ports 8 may be inclined, spring-loaded, or provided with other such biasing means so that a certain rotational speed is necessary before the balls 10 are expelled from the circumferential groove 12, and so that they are returned to the inner opening 9 once rotation is stopped or sufficiently reduced. Under these conditions the inner mandrel 4 can translate relative to the outer housing 2 by subsequently applying a fluid flow and thus creating a pressure difference across the choke 6. Under sufficient pressure (fluid flow), the force created is sufficient to overcome the resistive force created by the resistive assembly 16, and thus the inner mandrel translates relative to the ports 8 in the direction of the fluid flow, as is shown in FIGS. 7 and 8.

By translating the inner mandrel relative to the outer housing, a second functional mode may be induced, for example in the present embodiment, the ports 18 of the inner mandrel 4 are aligned with the outer ports 22, forming a plurality of open ports from the hollow duct 7 to the exterior of the downhole tool, through which some or all of the drilling fluid may flow, by-passing the rest of the drill string.

If, whilst maintaining the rotation of the drill string, the pressure at the choke 6 is reduced, by reducing the fluid flow, the resistive force created by the resistive assembly will be greater than the force created by the pressure difference and therefore there will be a net upwards force returning the inner mandrel to its original position. If the rotation of the drill string is then stopped the balls will again engage in the circumferential groove 12.

In the first embodiment where there is only one circumferential groove 12 and one set of balls 10, if the rotation of the drill string is stopped or sufficiently reduced whilst maintaining the pressure on the choke 6, the balls 10 will return towards the inner opening 9 as a result of the inclined or spring-loaded nature of the ports 8. By reducing the fluid flow the resistive force created by the resistive assembly will be greater than the force created by the pressure difference and therefore there will be a net upwards force returning the inner mandrel to its original position, and when aligned with the circumferential groove 12 the balls 10 will engage with the circumferential groove 12 and lock the inner mandrel 4 in relation to the outer housing 2.

In the first and second embodiments the inner mandrel 4 may be provided with a translation stop so that over a certain pressure the inner mandrel 4 will not translate any further, thus maintaining the alignment of the ports 18 with the ports 22, and also, in the second embodiment, the ports 8 and the second circumferential groove 14.

The first embodiment has been described wherein the positioning of the circumferential groove 12 allows the inner mandrel 4 to be locked relative to the outer housing 2 in a first position in which the inner mandrel 4 has not been translated relative to the outer housing 4. However, the circumferential groove may be positioned so that these components can be locked when they have been translated relative to one another due to the pressure difference created by the fluid flow, as achieved by groove 14 in the second embodiment.

In the second embodiment where there are two circumferential grooves and one set of balls or two sets of balls and one circumferential groove, if the rotation of the drill string is stopped or sufficiently reduced, whilst maintaining the pressure on the choke 6, the balls 10 will return towards the inner opening 9 as a result of the inclined or spring-loaded nature of the ports 8. Thus, if correctly aligned with the second circumferential groove 14, the balls 10 will fall into the groove 14 and therefore prevent the inner mandrel 4 from translating relative to the outer housing 2. This allows the by-pass function to be maintained regardless of the pressure of the drilling fluid passing through the drill string. By reducing the fluid flow the resistive force created by the resistive assembly will be greater than the force created by the pressure difference and therefore there will be a net upwards force which acts to return the inner mandrel to its original position. However, this is prevented by the balls 10 which are locked between the opposing edges of the ports 10 and the circumferential groove 14 due to this force. Under these conditions, the drill string may be rotated without the balls being released and thus without the functional mode of the downhole tool 1 being changed. If the inner mandrel 4 is not provided with a translation stop as described above then the balls may also be locked as a result of excessive pressure.

In order to unlock the inner mandrel 4 and allow it to translate relative to the outer housing 2, it is first necessary to apply sufficient fluid flow to unlock the balls 10 and thereafter rotation of the drill string will again cause the balls 10 to be expelled from circumferential groove 14. Maintaining sufficient rotation of the drill string retains the balls in the unlocked position and allows the inner mandrel 4 to be returned to its original position by reducing the fluid flow sufficiently to reduce the force created by the pressure on the choke 6 to below that of resistive force created by the resistive assembly. This results in a net upwards force and therefore the inner mandrel is returned to its original position. The balls need only be retained in the unlocked position until the inner mandrel has translated sufficiently so that the circumferential groove 14 is no longer aligned with the ports 8. By stopping or sufficiently reducing rotation of the drill string following the reduction of fluid flow, the balls 10 will return towards the inner opening 9 as a result of the inclined or spring-loaded nature of the ports 8 and, when aligned with the circumferential groove 12, the balls 10 will engage with the circumferential groove 12 and lock the inner mandrel 4 in relation to the outer housing 2. Alternatively the drill string may continue to rotate and the inner mandrel remains free to move in response to the fluid flow.

In order to provide correct alignment between the ports 18 of the inner mandrel 4 with the ports 22 of the outer housing 2, a follower assembly may be provided, as shown in FIGS. 3 to 8. The follower port 28 does not, in contrast to the ports 8, allow the follower 30 to substantially move in response to the centrifugal force created when the drill string is rotated. A substantially vertical orientation slot 32 is provided so that unless the follower 30 is aligned with this slot, the follower will constrain the relative movement of the inner mandrel 4 relative to the outer housing 2. This ensures that, if a transition from a first circumferential groove to a second circumferential groove is to be made, that the inner mandrel 4 and outer housing 2 are maintained in the desired orientation. It is also contemplated to use several orientation slots, which may provide full alignment at each orientation or may provide varying degrees of alignment to allow the rate of by-pass to be controlled more effectively. Alternative orientation slots may be used which are not vertical.

In response to the translation of the inner mandrel 4, the functional mode of the downhole tool may be changed. In the present embodiment, the functional mode is changed from that of a standard drill pipe to a by-pass function, venting the drilling fluid through the lateral ports in the tool. However, other functional modes may be switched to. For example, the translation and/or rotation of the inner mandrel 4 may cause a stabilizer to open from the outer housing 2, or may enable other functions required in drilling operations. The controller 3 has two main operations: sensing a plurality of input parameters and switching functional modes in response to the sensed input parameters. In the described embodiment, the choke 6 and balls 10 generally form a sensing device capable of sensing a plurality of input parameters. These parameters may be a flow variable of the drilling fluid and the rate of rotation of the downhole tool. The inner mandrel 4, choke 6, and resistive assembly 16 generally form a switching device capable of switching between functional modes.

In addition, it is contemplated that several functional modes may be incorporated into one downhole tool. This would require additional circumferential grooves. By applying different pressure levels under rotation, different functional modes may be switched to.

The operation of the downhole tool comprising the controller in accordance with the first embodiment of the present invention is also shown in FIG. 9. FIG. 9 shows a flow chart of the functional modes achieved by altering the input parameters in a predetermined order. FIG. 9 shows how turning on the drilling fluid flow and then the rotation of the tool, and vice versa, will result in different functional modes. In the first order, wherein the downhole tool is rotated and then the fluid flow is turned on, the mandrel 4 may move from a first position, corresponding to circumferential groove 12, to a second position. In this position the functional mode of the downhole tool is changed. Once in the second position, by first stopping the fluid flow and then stopping the rotation of the drill string, or vice versa, the mandrel 4 will return to the first position and thus to the original functional mode with the balls 10 again engaged in the circumferential groove 12. However, if when in the first position, the flow of drilling fluid is first turned on, the balls will be locked between opposing edges of the ports 8 and the circumferential groove 12, and thus any subsequent rotation of the downhole tool will not cause the balls 10 to be expelled from the circumferential groove 12, so that the functional mode is maintained.

The operation of the downhole tool comprising the controller in accordance with the second embodiment of the present invention is also shown in FIG. 10. The movement of the downhole tool from the first position to the second position is substantially as for the first embodiment. However, once in the second position, the mandrel may be maintained in this position by first stopping the rotation of the drill string. By doing so, the centrifugal force is removed and the balls 10 return to rest in the second circumferential groove 14. The mandrel will stay in the second position regardless of whether the flow of drilling fluid is stopped, reduced, or increased. If, however, the flow is stopped before the rotation of the drill string is stopped, then the mandrel will return to the first position as in the first embodiment. Once the mandrel is in the second position with the flow off, the mandrel cannot be released by rotating the tool. In order to release the mandrel it is first necessary to apply sufficient flow to unlock the balls and then rotation of the downhole tool will cause the balls to be expelled from the second groove 14, allowing the flow to then be stopped or sufficiently reduced in order to return the mandrel to the first position.

In another embodiment of the present invention it is contemplated that, where possible and if so desired, the mechanical means of the first and second embodiments may be replaced by or used in conjunction with electrical devices. For example the balls 10 may be replaced by an actuated locking means and an electrical or electromagnetic sensing device or devices may sense a predetermined state of any of the previously mentioned input parameters in which the locking means is activated. The locking means may be actuated by any known means, for example, a solenoid may be used to push and/or pull the locking means into the desired position. Furthermore the choke and/or resistive assembly may be replaced by an actuator which causes the inner mandrel to translate relative to the outer housing when a predetermined state is sensed. Alternatively the inner mandrel and outer housing assembly may be removed or altered if necessary or if enabled by adapting the mechanical means to electrical devices. For example, the functional mode may be switched directly by an electrical device without the need for the translation of the inner mandrel.

To avoid unnecessary duplication of effort and repetition in the text, certain features are described in relation to only one or several aspects or embodiments of the invention. However, it is to be understood that, where it is technically possible, features described in relation to any aspect or embodiment of the invention may also be used with any other aspect or embodiment of the invention. 

1.-32. (canceled)
 33. A controller for switching between functional modes of a downhole tool, the controller comprising: an outer housing; an inner mandrel located within the outer housing, through which drilling fluid may pass; and a switching device adapted for switching between a plurality of functional modes by translating the inner mandrel within the outer housing; wherein the outer housing comprises a ball which, when the downhole tool is rotating below a specific rate, protrudes from an inner surface of the housing, if unobstructed, and which is flush with the inner surface of the housing when the downhole tool is rotating at or above the specific rate; wherein the inner mandrel further comprises a circumferential groove which receives the ball when rotation is below the specific rate so as to prevent translation of the inner mandrel.
 34. The controller of claim 33, wherein the ball is provided in an inclined port in the housing wall.
 35. The controller of claim 33, wherein the ball is spring loaded.
 36. The controller of claim 33, wherein the inner mandrel comprises one or more additional circumferential grooves which receive the ball.
 37. The controller of claim 33, wherein, if whilst the ball protrudes from the inner surface of the housing the pressure of the drilling fluid is under or exceeds a predetermined value, then the ball is prevented from becoming flush with the inner surface of the housing.
 38. The controller of claim 33, wherein the outer housing comprises a plurality of circumferentially aligned balls.
 39. The controller of claim 38, wherein the outer housing comprises one or more additional sets of circumferentially aligned balls.
 40. The controller of claim 33, wherein the switching device comprises an actuator operable to translate the inner mandrel within the housing to switch between the functional modes of the downhole tool.
 41. The controller of claim 40, wherein the actuator is electrical.
 42. The controller of claim 33, wherein the switching device comprises a choke to provide a pressure difference inside the inner mandrel, the inner mandrel being translatable within the housing in response to the pressure difference to switch between the functional modes of the downhole tool.
 43. The controller of claim 42, wherein a resistive force is provided to resist translation of the inner mandrel in response to the pressure difference.
 44. The controller of claim 33, wherein the functional modes include any of: acting as a conventional drill pipe, opening ports, moving of stabilizers, blades or sleeves, or a steering operation of a drill string or drill bit.
 45. The controller of claim 44, wherein the switching device comprises an actuator operable to translate the inner mandrel within the housing to switch between the functional modes of the downhole tool.
 46. The controller of claim 44, wherein the switching device comprises a choke to provide a pressure difference inside the inner mandrel, the inner mandrel being translatable within the housing in response to the pressure difference to switch between the functional modes of the downhole tool.
 47. The controller of claim 33, wherein the functional mode is determined from the axially translated displacement of the inner mandrel within the housing.
 48. The controller of claim 47, wherein the switching device comprises an actuator operable to translate the inner mandrel within the housing to switch between the functional modes of the downhole tool.
 49. The controller of claim 47, wherein the switching device comprises a choke to provide a pressure difference inside the inner mandrel, the inner mandrel being translatable within the housing in response to the pressure difference to switch between the functional modes of the downhole tool.
 50. A method of controlling a downhole tool using a controller, the controller comprising: an outer housing; and an inner mandrel located within the outer housing, through which drilling fluid may pass; wherein the outer housing comprises a ball which protrudes from an inner surface of the outer housing when the downhole tool is rotating below a specific rate, and the inner mandrel comprises a circumferential groove for receiving the ball; the method comprising: rotating the downhole tool above a specific rate so that the ball is flush with the inner surface of the outer housing; and translating the inner mandrel within the outer housing so as to switch between a plurality of functional modes.
 51. A controller for switching between functional modes of a downhole tool, the controller comprising: an outer housing; an inner mandrel located within the outer housing, through which drilling fluid may pass; a switching device adapted for switching between a plurality of functional modes by translating the inner mandrel within the outer housing; wherein the switching device comprises an actuator operable to translate the inner mandrel within the housing to switch between the functional modes of the downhole tool; an electrically actuated locking means operable to lock the inner mandrel relative to the housing to prevent axial translation; and a sensing device adapted to sense a plurality of input parameters; wherein the locking means releases the inner mandrel and the switching device switches from a first of the functional modes to a second of the functional modes when the sensing device senses a predetermined state of at least two of the input parameters.
 52. A method of controlling a downhole tool using a controller, the controller comprising: an outer housing; and an inner mandrel located within the outer housing, through which drilling fluid may pass; the method comprising: locking the inner mandrel relative to the outer housing with an electrically actuated locking means to prevent axial translation; sensing a plurality of input parameters; and releasing the inner mandrel with the locking means and translating the inner mandrel within the outer housing an electrical actuator so as to switch between a plurality of functional modes when a predetermined state of at least two of the input parameters is sensed. 